<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p id="p1">IE事件注册</p>
<script>
var p1 = document.getElementById("p1");			//捕获段落元素
p1.attachEvent("onmouseover", function(){
    p1.style.background = 'blue';
});										//注册mouseover事件
p1.attachEvent("onmouseout", function(){
    p1.style.background = 'red';
});										//注册mouseout事件
</script>
</body> 
</html>
